﻿using LL2025.Libs.Queue;

var config = new BusConfig
{
    RabbitMqHost = "124.221.160.244",
    QueueName = "queue_" + Guid.NewGuid().ToString("N"), //只要订阅者队列名不同，同样类型的，就可以推给每个人，一样轮询推送
    Username = "ll",
    Password = "123456",
};

using var busManager = new BusManager(config);

// 订阅消息接收事件
busManager.MessageReceived += (message) =>
{
    Console.WriteLine($"Order Submitted: {message.OrderId}");
};

await busManager.StartAsync();
Console.WriteLine("订阅成功");
Console.ReadLine();


// 等待消息处理

Console.ReadKey();